import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "login",
    redirect:"/user/login",
    children:[
      {
        path:"/user/login",
        component:()=>import("@/views/login/LoginView.vue")
      },{
        path:"/user/register",
        component:()=>import("@/views/login/RegisterView.vue")
      }
    ]
  },
  {
    path: "/home",
    name: "layout",
    component:()=>import("@/views/layout/Layout.vue"),

    children:[
    {
      path:"home",
      name:"home",
      component:()=>import("@/views/home/HomeView.vue"),
      children: [
        {
          path: "/content",
          name: "topContent",
          component: () => import("@/views/home/ContentListView.vue"),
          props:true
        },
      ],
    },
    ]
  }
  
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
